package com.ys.p3Set接口与HashSet与LinkedHashSet;

import java.util.Arrays;

/**
 * 描述:
 *
 * @author CodeYang
 * @version 2020/12/28 14:37
 */
public class 冒泡排序测试 {
    public static void main(String[] args) {


        int[] arr = {1,2,7,9,10,50,20,21};

        int len = arr.length;

        for (int i = 0; i < len -1; i++) {
            for (int j = 0; j < len-1; j++) {
                if (arr[j]<arr[j+1]){
                    int temp ;
                    temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] =temp;
                }
            }


        }

        System.out.println(Arrays.toString(arr));
    }
}
